#pragma once
#ifndef ALGO_MD5_H__
#define ALGO_MD5_H__
#include "MCSpace.h"
#include <stdint.h>

namespace Mclib {
/* Data structure for MD5 (Message Digest) computation */
typedef struct {
	uint32_t i[2];                   /* number of _bits_ handled mod 2^64 */
	uint32_t buf[4];                                    /* scratch buffer */
	unsigned char in[64];                              /* input buffer */
	unsigned char digest[16];     /* actual digest after MD5Final call */
} MD5_CTX;

class MCINFO_API CMD5
{
public:
	static void MD5Init(MD5_CTX * mdContext);
	static void MD5Update(MD5_CTX * mdContext, unsigned char * inBuf, uint32_t inLen);
	static void MD5Final(MD5_CTX *mdContext);
	static void MD5Transform(uint32_t * buf, uint32_t * in);
};

}
#endif //
